package com.leen.user.controller;

import com.leen.common.vo.ResultEnum;
import com.leen.common.vo.ResultVO;
import com.leen.user.entity.YxUserExtract;
import com.leen.user.repository.YxUserExtractRepository;
import com.leen.user.service.YxUserExtractService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.parameters.P;
import org.springframework.web.bind.annotation.*;

/**
 * 用户提现表接口
 */
@RestController
@Api(tags = "用户提现表API")
@RequestMapping(value = "/yxuserextract")
public class YxUserExtractController {

    @Autowired
    private YxUserExtractService yxUserExtractService;



    @ApiOperation(value = "新增数据")
    @PostMapping(value = "yxuserextract/add")
    public ResultVO<String> add(@RequestBody YxUserExtract yxUserExtract){
        YxUserExtract save = this.yxUserExtractService.save(yxUserExtract);
        return save!=null?ResultVO.success(ResultEnum.DB_SUCCESS):ResultVO.failed(ResultEnum.DB_FAILED);
    }
    @ApiOperation(value = "修改数据")
    @PostMapping(value = "/yxuserextract/update")
    public ResultVO<String> update(@RequestBody YxUserExtract yxUserExtract){
        YxUserExtract update = this.yxUserExtractService.save(yxUserExtract);
        return update!=null?ResultVO.success(ResultEnum.DB_SUCCESS):ResultVO.failed(ResultEnum.DB_FAILED);

    }

}
